<html>
<head>
    <title>Search Field with Transform</title>
    <script src="../resources/common.js"></script>
    <script type="text/javascript" charset="utf-8">
      if (window.testRunner)
        testRunner.dumpAsText();
    </script>
</head>
<body>
    <p>
        Test for <a href="https://bugs.webkit.org/show_bug.cgi?id=24503">https://bugs.webkit.org/show_bug.cgi?id=24503</a>:<br>
        Can't click the clear button of an absolutely positioned search field.
    </p>
    <input type="search" id="target" value="Search me" style="position: absolute; left: 50px; top: 50px;">
    <p id="result" style="margin-top: 60px;">
        Clicking the (x) button should clear the field.
    </p>
    <script>
        if (window.eventSender) {
            var target = document.getElementById("target");
            var cancelPos = searchCancelButtonPosition(target);
            eventSender.mouseMoveTo(cancelPos.x, cancelPos.y);
            eventSender.mouseDown();
            eventSender.mouseUp();
            var result = document.getElementById("result");
            if (target.value == "")
                result.innerText = "PASS";
            else
                result.innerText = "FAIL";
            
            target.value = "Some other text";
        }
    </script>
</body>
</html>
